var ProuctionOrderInfo = function () {
  var template = /* html */ `
    <div class="prouction-order-info" v-loading.fullscreen.lock="loading">
      <el-table fit stripe border :data="detailList">
        <el-table-column prop="orderNo" label="订单编号" min-width="140px" header-align="center"></el-table-column> 
        <el-table-column prop="articleNo" label="客户型号" min-width="120px" header-align="center"></el-table-column>
        <el-table-column :resizable="false" prop="lineNo" label="订单序号" width="75px" align="center">
          <template slot-scope="scope">
            <span>{{scope.row.lineNo==='-1'?globalConfig.orderDefaultRowIndex:scope.row.lineNo}}</span>
          </template>
        </el-table-column> 
        <el-table-column prop="materialType" label="物料类型" min-width="120px" header-align="center"></el-table-column>
        <el-table-column prop="color" label="编号" min-width="120px" header-align="center"></el-table-column>
        <el-table-column prop="colorDescription" label="描述" min-width="120px" header-align="center"></el-table-column>
        <el-table-column prop="materialModel" label="规格" min-width="120px" header-align="center"></el-table-column>
      </el-table>
    </div>
  `;

  return {
    props: {
      warehouse: {
        type: Object,
        required: true
      }
    },

    data: function () {
      return {
        loading:false,
        detailList:[]
      };
    },

    created:function(){
      this.setDetailList();
    },

    methods:{
      setDetailList:function(){
        var warehouse = this.warehouse;

        this.loading = true;
        var self = this;
        ajaxRequest("companyMaterial/getMaterialOkDetailByOrder",{
          orderId: warehouse.orderId,
					lineNo: warehouse.rowIndex
        }).then(function(detailList){
          self.loading = false;
          self.detailList = detailList;
        }).catch(function(){
          self.loading = false;
        });
      }
    },

    template: template
  };
}();